#!/usr/bin/env bash
product=$1
echo "market and archives apk build for $product."
if [ $product == "ysdq" ]; then
    ./gradlew -Pmarket=channel/ysdq.txt clean apkYsdqRelease;
    #./gradlew --offline -Pmarket=channel/cjsp.txt clean apkCjspRelease
elif [ $product == "cjsp" ]; then
    ./gradlew -Pmarket=channel/cjsp.txt clean apkCjspRelease;
elif [ $product == "kuaikan" ]; then
    ./gradlew -Pmarket=channel/kuaikan.txt clean apkKuaikanRelease;
elif [ $product == "lightning" ]; then
    ./gradlew -Pmarket=channel/ysdq.txt clean apkLightningRelease;
elif [ $product == "ysdqNoAd" ]; then
    ./gradlew -Pmarket=channel/noadYsdq.txt clean apkYsdqRelease;
elif [ $product == "kuaikanNoAd" ]; then
    ./gradlew -Pmarket=channel/noadKuaikan.txt clean apkKuaikanRelease;
elif [ $product == "cjspNoAd" ]; then
    ./gradlew -Pmarket=channel/noadCjsp.txt clean apkCjspRelease;
elif [ $product == "tuiguang" ]; then
    ./gradlew -Pmarket=channel/tuiguang.txt clean apkYsdqRelease;
else
    echo "Product name error! Please input the right product name!"
fi
cd ..
